<?php
if (isset($_POST['d1']) && isset($_POST['ida']) && isset($_POST['fdes'])){
    $openid=$_POST['fdes'];
    $d1=trim($_POST['d1']);
    $d2=trim($_POST['d2']);
    $d3=trim($_POST['d3']);
    $ida=$_POST['ida'];
    $idb=$_POST['idb'];
    $idc=$_POST['idc'];
    $nianji=trim(addslashes($_POST['nj']));
	include_once("../c/config.php");
	$mysqli = new mysqli($dbhost, $dbuser, $dbpwd, $dbName);
	if (!$mysqli->set_charset("utf8")) {printf("Error loading character set utf8: %s\n", $mysqliTwo->error);}
	
	
	$thisTable=getC3Table($nianji);
	
    $sql="select id from ".$thisTable." where openid='".$openid."'  limit 0, 1";
    $query=$mysqli->query($sql);
    if($query->num_rows>0){
    }else{
        $mysqli->query("insert into ".$thisTable."(openid,ida,idb,idc,d1,d2,d3,createtime) 
values('".$openid."','".$ida."','".$idb."','".$idc."','".$d1."','".$d2."','".$d3."','".date("Y-m-d H:i:s")."') ");
    }

    echo json_encode(array('s'=>'ok'));

	$mysqli->close();
}


?>